home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 2000
/
MacHack 2000.toast
/
pc
/
The Hacks
/
Softshoe
/
Lisa's Mac Parts
/
Debug Timer
/
DebugTimer.cp
next >
Wrap
Text File
|
2000-06-23
|
606b
|
48 lines
// DebugTimer.cp
#ifndef DebugTimer_h
#include "DebugTimer.h"
#endif
#ifndef __Timer__
#include <Timer.h>
#endif
#ifndef DebugMessage_h
#include "DebugMessage.h"
#endif
#include <Events.h>
DebugTimer::DebugTimer()
: start( Now() ),
running( true )
{
}
uint32 DebugTimer::Now()
{
return TickCount();
}
void DebugTimer::Start()
{
running = true;
start = TickCount();
}
void DebugTimer::Stop()
{
uint32 time = Now() - start;
DebugMessage message;
message << time << " ticks";
message.Show();
running = false;
}
DebugTimer::~DebugTimer()
{
if ( running )
Stop();
}